/* signal.c
 *      Test program for the exec statement in nachos
 */
#include "syscall.h"

int main() {

    char fname[] = "signal_child";
    char arg[] = "1";
    char* args[] = {arg, 0};

    int status;
    int child_id;

    child_id = Exec(fname, args);

    //if the exec call failed, then return an exit code to be able to tell
    //it failed
    if(child_id == -1) {
        Exit(2);
    }

    //now test the signalling, in particular its time to kill the child
    status = Kill(KILL_kill, child_id);

    if(status == 0) {
        //we had a success
        Exit(0);
    } else {
        Exit(1);
    }

}
